package com.sentiment.database.bean;
import java.util.Date;

import org.bson.Document;import org.bson.types.ObjectId;

public class Keyword  {
	@Override
	public String toString() {
		return "Keyword [_id=" + _id + ", date=" + date + ", keyword=" + keyword + ", type=" + type + "]";
	}


	
	public Keyword() {
		super();
	}



	public static final String dbName = "SentimentDB";
	public static final String collection = "Keyword";
	
	private ObjectId _id;
	private String date;
	private String keyword;
	private String type;
	
	public Keyword(Document doc){
		super();
		_id = doc.getObjectId("_id");
		date = doc.getString("date");
		keyword = doc.getString("keyword");
		type = doc.getString("type");
		
	}

	
	
	public Keyword(String date, String keyword, String type) {
		super();
		this.date = date;
		this.keyword = keyword;
		this.type = type;
	}



	public Document toDocument(){
		return new Document("date", date).append("keyword", keyword).append("type", type);
	}

	public Document toDocument_id(){
		return new Document("_id", _id).append("date", date).append("keyword", keyword).append("type", type);
	}

	public String get_id() {
		return _id.toString();
	}



	public void set_id(String _id) {
		this._id = new ObjectId(_id);
	}



	public String getDate() {
		return date;
	}



	public void setDate(String date) {
		this.date = date;
	}



	public String getKeyword() {
		return keyword;
	}



	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}



	public String getType() {
		return type;
	}



	public void setType(String type) {
		this.type = type;
	}



	
	
	
}
